B Binance · The world's largest crypto exchangeBinance Sign up → AD OKX OKX · A leading global crypto exchangeOKX Sign up → AD

Text Diff Checker

Compare two texts line by line and see what changed

What this tool does

Paste an original and a changed text into the two boxes and press compare. The tool lines the two up line by line and shows, in one continuous view, unchanged lines, removed lines (red, marked −) and added lines (green, marked +). A summary of added and removed line counts appears on top, or a message that the texts are completely identical. Use it to compare contract or report revisions, check changes to config files or code, or confirm that a copied text matches the original.

How it is calculated

Both texts are split at line breaks, and the longest common subsequence is found with dynamic programming. The lines that remain in the same order in both are kept as unchanged, lines only in the original are marked removed, and lines only in the new version are marked added. A line must match exactly, down to every character and space, to count as the same. For example, if the original is 'apple / pear / grape' and the new text is 'apple / orange / grape', the result reads 'apple (same) → −pear → +orange → grape (same)' with the summary '+1 added · −1 removed'. Where a line was changed in place, the removed line comes first and the added line follows. Everything is computed in your browser and nothing you enter is sent anywhere.

  • Paste the original text into the left (or top) box.
  • Paste the changed text into the right (or bottom) box.
  • Press compare to see the added and removed counts and the line-by-line result.
  • Red − lines exist only in the original, green + lines only in the new text, and uncolored lines are the same in both.
  • After editing either text, press compare again to recalculate.

Things to know

  • Trailing spaces and tab versus space differences count as different lines. If two lines look identical but are flagged, suspect invisible whitespace.
  • Mixing Windows line endings with Mac or Linux ones can make nearly every line differ. Comparing texts copied from the same editor is safest.
  • Changing a single character turns the whole line into a removed and added pair. Putting one sentence per line narrows down where long paragraphs changed.
  • Reordered lines are not detected as moves; they show as removed in one place and added in another.
  • Blank lines count as lines too, so a different number of empty lines between paragraphs shows up as a difference.
  • The work grows with the product of both line counts, so documents with thousands of lines may be slow. Compare just the section around the change.
  • Nothing is saved, so keep a copy of any text you need before reloading.

Frequently asked questions

I changed one character but the whole line shows as changed.

This tool compares by line. The line appears as a removed and added pair, so look at the two lines stacked together to spot the changed character.

How are lines that only moved shown?

As removed at the old position and added at the new one. Moves are not recognized separately.

Is it safe to paste sensitive documents like contracts?

The comparison is computed only in your browser, and the page has no code that sends the text to a server. Nothing is saved, so it disappears when you close the page.

Can I use it for code or config files?

Yes. Just note that indentation or trailing-space changes count as differences, so a file that was only reformatted may look more changed than it really is.

← na.to home